package com.quanyan.video.controller;

import com.quanyan.api.APIRequest;
import com.quanyan.api.APIResponse;
import com.quanyan.common.enums.BaseEnum;
import com.quanyan.video.entity.Project;
import com.quanyan.video.request.ReqBucket;
import com.quanyan.video.request.ReqVideo;
import com.quanyan.video.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by wmb on 2016/6/27.
 */
@RestController
@RequestMapping("/api/video")
public class VideoController {

    @Autowired
    private VideoService videoService;
    @RequestMapping(value="/sign",method = RequestMethod.POST)
    public APIResponse<String> sign(@RequestBody ReqVideo reqVideo){
        return videoService.getSign(reqVideo);
    }

    @RequestMapping(value = "/addProject",method = RequestMethod.POST)
    public APIResponse<Integer> addProject(@RequestBody Project project){
        return videoService.addProject(project);
    }

    @RequestMapping(value="/addBucket",method = RequestMethod.POST)
    public APIResponse<Integer> addBucket(@RequestBody ReqBucket reqBucket){
        return videoService.addBucket(reqBucket);
    }

    @RequestMapping(value="/health")
    public APIResponse<BaseEnum> health(){
        return APIResponse.returnSuccess();
    }
}

